Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use registry for class setup functions #165

Merged
merged 6 commits into from
Dec 4, 2024

Conversation

Carifio24
Copy link
Member

While #164 works fine, I wasn't a huge fan of having to strongly couple the Hubble-specific pieces with the general class-creation method. This PR provides a solution to this - we create a registry for class setup functions, and the individual story modules can then register their particular setup functionality. We can then call all of the relevant class-specific functions from the top-level class-creation method in a generic way.

@Carifio24
Copy link
Member Author

As part of this, since we do all of the story-specific setup as part of a transaction together with the class creation (so that a class can't be created which is then in a broken state due to setup issues), I've updated our setup to use cls-hooked so that any queries that happen inside of a transaction block are automatically part of that transaction (see the relevant documentation here).

@Carifio24 Carifio24 merged commit f2a0175 into cosmicds:main Dec 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant